package hcn.protocol.ods.casehistory;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

/**
 * @program: 20190427StandardEdition
 *
 * @description: 病例复印支付状态枚举
 *
 * @author: zcj
 *
 * @create: 2019年8月26日12:08:54
 **/
@NoArgsConstructor
@AllArgsConstructor
public enum BlPayStateEnum {
    toBePayed("1","未支付"),
    successful("2","已支付"),
    canceled("3", "已关闭");

    private String code;
    private String description;

    public static final String getDescription(String code){
        for (BlPayStateEnum type : BlPayStateEnum.values()){
            if (type.getCode().equalsIgnoreCase(code.trim())){
                return type.description;
            }
        }
        return null;
    }
    public static BlPayStateEnum getBlPayStateEnum(String code) {
        int i = Integer.parseInt(code);
        if (i < 1 || i > values().length) {
            return null;
        }
        return values()[i - 1];
    }
    public String getCode() {
        return code;
    }

    public String getDisplay() {
        return description;
    }
}
